package com.personal.gateway.custom.customEnum;

/**
 * @program: FlinkGateway
 * @description:
 * @author: yangliao
 * @create: 2021-08-23
 * TODO 这里还需要整理一下
 */
public enum FlinkGateWayCommandEnum {

    /**
     * 创建
     */
    CREATE("创建", 1),
    /**
     * 编辑
     */
    EDIT("编辑", 2),
    /**
     * 启动-无SAVEPOINT
     */
    START_NO_SAVE_POINT("启动-无SAVEPOINT", 3),
    /**
     * 启动-使用SAVEPOINT
     */
    START_WITH_SAVE_POINT("启动-使用SAVEPOINT", 4),
    /**
     * 停止-SAVEPOINT
     */
    STOP_WITH_SAVE_POINT("停止-SAVEPOINT", 5),
    /**
     * 删除
     */
    DELETE("删除", 6),
    /**
     * 编辑报警信息
     */
    ALARM_EDIT("编辑报警信息", 7);

    private String name;

    private int value;

    FlinkGateWayCommandEnum(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public static String getName(int value) {
        for (FlinkGateWayCommandEnum c : FlinkGateWayCommandEnum.values()) {
            if (c.getValue() == value) {
                return c.name;
            }
        }
        return null;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }
}
